package com.sc.util;

import cn.hutool.core.util.ReUtil;

/**
 * 正则表达式工具类
 * @author LiYe
 */
public class RegexUtil {
    private static final String PHONE_NUMBER_PATTERN = "^1(3|4|5|6|7|8|9)\\d{9}$";

    /**
     * 判断字符串是否满足手机号正则匹配
     * @param phoneNumber 要校验的手机号
     * @return
     */
    public static boolean isValidPhoneNumber(String phoneNumber) {
        return ReUtil.isMatch(PHONE_NUMBER_PATTERN, phoneNumber);
    }
}
